/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 */

import { Project } from '../../../../../src/base/external/core/hvigor-core-node.js';
import { mockProjectFromResourcesPath } from '../../common/init-project';
import { DefaultInternalTask } from '../../../../../src/base/internal/task/core/default-internal-task';
import { noop } from '../../../../../src/common/util/noop';

const project: Project = mockProjectFromResourcesPath('common-test');

describe('test default task', () => {
  const moduleName = 'module1';
  const module = project.findModuleByName(moduleName)!;

  test('test taskDetails...', () => {
    const task1 = new DefaultInternalTask(module, {
      name: 'test',
      description: 'This is a test Task',
      group: 'test',
      isEnabled: false
    }, noop);
    expect(task1.getName()).toBe('test');
    expect(task1.getGroup()).toBe('test');
    expect(task1.getDescription()).toBe('This is a test Task');
    expect(task1.getEnabled()).toBeFalsy();
  });
});
